/*** 
 * @Author: Yanan Chen
 * @Date: 2021-11-02 13:47:03
 * @LastEditTime: 2021-12-09 11:17:48
 * @LastEditors: Yanan Chen
 * @Description: 
 * @FilePath: \fw\esp32\Src\APP\app_ble.h
 * @
 */
#ifndef PRJ_APP_BLE_H
#define PRJ_APP_BLE_H

#include "hal_function.h"



class AppBLE 
{
public:
    AppBLE();
    ~AppBLE(){};
    void init();
    void start();
    void stop();
    char getadv_cfg_done(){return adv_cfg_done;}
    static void threadCreate();
    static void ble_gap_evt_handle(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *param);
    static void gatts_profile_event_handler(uint16_t app_index,esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t *param);
    static void gatts_event_handler(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t *param);
private:
    static TaskHandle_t  taskHandle;
    static TimerHandle_t timerHandle;
    static void thread(void *a);
    static void threadtimeCallback(TimerHandle_t handle);

    char adv_cfg_done;

};

extern AppBLE  *bleObj;
#endif